home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / tools.exe / EXAMPLES / GEO / GEMAIN.S < prev    next >
Text File  |  1991-07-18  |  1KB  |  27 lines

  1.     TITLE Geometry Library Main Module
  2.  
  3. INCLUDE GEROMID.H
  4. INCLUDE GEEXTDEC.H
  5.  
  6. *****************************************************************
  7. * The main module contains the dispatchees of the user words.
  8. * Each routine is named with a NULLNAME compiler directive, and
  9. * has a corresponding entry in the external declarations file.
  10. *****************************************************************
  11. NULLNAME GEDoACone ( %radius %height --> %area )
  12. * Calculates the area of a cone given its radius and height
  13. ::
  14.   DUP %* OVER DUP %*            ( r h^2 r^2 --> )
  15.   DUPROT %+ %SQRT               ( r r^2 SQRT[r^2+h^2] --> )
  16.   ROT GEtimesPI %*              ( r^2 PI*r*SQRT[r^2+h^2] --> )
  17.   SWAP GEtimesPI %+             ( %area )
  18. ;
  19. *****************************************************************
  20. NULLNAME GEDoVCone ( %radius %height --> %volume )
  21. * Calculates the volume of a cone given its radius and height
  22. ::
  23.   OVER %* %*
  24.   GEtimesPI %3 %/
  25. ;
  26. *****************************************************************
  27.